import numpy as np
from PIL import Image
a = np.array(Image.open('D:\cat.jpg'))
print(a.shape,a.dtype,a[0,0,:])
b = 255 - a
im = Image.fromarray(b.astype('uint8'))
im.save('cat2.jpg')
c = a.copy()
c[::2] = 0
Image.fromarray(c).save('cat3.jpg')
c = a.copy()
c[:,::2] =255
Image.fromarray(c).save('cat4.jpg')
